<?php
/**
 * Created by PhpStorm.
 * User: lizx
 * Date: 2018/2/28
 * Time: 14:49
 */

namespace app\api\repository;

use app\common\Model\UserAddress;
use app\common\Service;

class AddressRepository extends Service
{
    /**
     * 根据地址id查询用于保存订单快照的信息
     */
    public function orderAddress($address_id)
    {
        $addr = UserAddress::where(['id'=>$address_id])
            ->column('id,consignee,province,city,district,address,building,mobile,lat,lng');
        return empty($addr) ? [] : $addr[$address_id];
    }
}
